﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using AR.Entity;
using System.Diagnostics;

namespace NRemedy.Test
{
    [TestClass]
    public class IPInit
    {
        [TestMethod]
        public void ARServer_IPAddressesInit()
        {
            IARServer server = ARServerFactory.CreateARServer();
            server.LogIn(new ARLogInRequestContext
            {
                UserName = "parkerz.admin",
                Server = "vs31ar03",
                Password = "admin",
                Authentication = string.Empty
            });

            IIPDataProvider provider = DataProviderFactory.CreateProvider();

            foreach (ASB_AdminIPConfig ip in provider.GetIPs())
            {
                ip.Submitter = "parkerz.admin";
                ip.Status = "New";
                ip.Short_Description = "parkerz.admin";
                server.CreateEntry(ip);
                //Debug.WriteLine(ip.cChr_IPAddress + "----" + ip.cChr_Segment + "----" + ip.cChr_Gateway + "----" + ip.cChr_Mask + "----" + ip.cInt_IsUsed);
            }

            server.LogOut();
        }
    }
}
